﻿using System.Web.Mvc;
using FlitBit.Wireup;

namespace FlitBit.IoC.Mvc
{
    /// <summary>
    /// Wires up the Controller Factories, enabling the contructor injection for Controllers and WebApi's alike.
    /// </summary>
    public sealed class AssemblyWireupMvcOnlyIoCControllerFactory : IWireupCommand
    {
        public void Execute(IWireupCoordinator coordinator)
        {
            ControllerBuilder.Current.SetControllerFactory(new IocEnabledMvcControllerFactory());
        }
    }
}